#!/bin/sh
gate_server_pid=$(ps gaux | grep gate_server | grep -v grep | awk '{print $2}')
if [ -n "$gate_server_pid" ];then
	echo "the runing gate_server's pid is:"$gate_server_pid
	kill -9 $gate_server_pid
	echo "gate server have been killed"
	#./gate_server -v=1 -daemon=true -logtostderr=0
else
	echo "current no gate server running...."
	#./gate_server -v=1 -daemon=true -logtostderr=0
fi


db_server_pid=$(ps gaux | grep db_server | grep -v grep | awk '{print $2}')
if [ -n "$db_server_pid" ];then
	echo "the runing db_server's pid is:"$db_server_pid
	kill -9 $db_server_pid
	echo "db server have been killed"
	#./db_server -v=2 -daemon=true -logtostderr=0
else
	echo "current no db server running...."
	#./db_server -v=2 -daemon=true -logtostderr=0
fi


game_server_pid=$(ps gaux | grep game_server | grep -v grep | awk '{print $2}')
if [ -n "$game_server_pid" ];then
	echo "the runing game_server's pid is:"$game_server_pid
	kill -9 $game_server_pid
	echo "game server have been killed"
	#./game_server -v=99 -daemon=true -logtostderr=0 -index=1
else
	echo "current no game server running...."
	#./game_server -v=99 -daemon=true -logtostderr=0 -index=1
fi

./gate_server -v=1 -daemon=true -logtostderr=0
./db_server   -v=1 -daemon=true -logtostderr=0
sleep 3
./game_server -v=1 -daemon=true -logtostderr=0 -index=1

ps aux|grep _server












